﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace SquadPlacer
{
    public static class ResourceLoader
    {
        public static void loadResources(ContentManager Content)
        {
            loadGameSprites(Content);
            loadUnitSprites(Content);
        }

        public static Texture2D getTexture(string name)
        {
            return sprites[name];
        }

        private static void loadGameSprites(ContentManager Content)
        {
            //tile sprite.
            #region tiles
            Texture2D tile = Content.Load<Texture2D>("State/tile");
            sprites.Add("tile", tile);
            Texture2D selected = Content.Load<Texture2D>("State/selected");
            sprites.Add("selected", selected);
            #endregion
        }

        private static void loadUnitSprites(ContentManager Content)
        {
            sprites.Add("Archer", Content.Load<Texture2D>("Units/Heirs/archer"));
            sprites.Add("Footman", Content.Load<Texture2D>("Units/Heirs/swordsman"));
            sprites.Add("Knight", Content.Load<Texture2D>("Units/Heirs/knight"));

            sprites.Add("Knife_thrower", Content.Load<Texture2D>("Units/Renegade/rogue"));
            sprites.Add("Militian", Content.Load<Texture2D>("Units/Renegade/militian"));
            sprites.Add("Ranger", Content.Load<Texture2D>("Units/Renegade/ranger"));
        }

        private static Dictionary<String, Texture2D> sprites = new Dictionary<string, Texture2D>();
    }
}
